<?php
class ChannelModel extends Model{
	public function add_channel(){
		return M('news_channel','','DB_MEETING')->add($_POST);	
	}
	public function del_channel(){
		$data['time_delete']=time();
		return M('news_channel','','DB_MEETING')->where('channel_id='.$_GET['channel_id'])->save($data);
	}
	public function upt_channel(){
		return M('news_channel','','DB_MEETING')->where('channel_id='.$_POST['channel_id'])->save($_POST);
	}
	public function get_one(){
		return M('news_channel','','DB_MEETING')->where('channel_id='.$_GET['channel_id'])->find();
	}
	public function get_all(){
		return M('news_channel','','DB_MEETING')->where('time_insert>time_delete')->select();	
	}
	public function get_list(){
		$seach=$_GET['seach']!=''?$_GET['seach']:'';
		$order=$_GET['order']!=''?$_GET['order']:'channel_id desc';
		$where='time_insert > time_delete';
		$col  ='channel_name';
		return pageing($tbName='news_channel',$pageSize=7,$lang,$seach,$order,$where,$col);
	}
}
?>